using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using TMM.Common;
using System.IO;
using System.Threading.Tasks;

namespace TMM.Common
{
    public abstract class ServersManagerBase
    {
        public abstract T GetData<T>(string address);
        public Server GetServer(string serverName)
        {
            if (string.IsNullOrWhiteSpace(serverName))
                return null;

            try
            {
                var address = string.Format("{0}Home/GetConnectionUrl?serverCode={1}", Constants.ApplicationUrl, serverName);

                return GetData<Server>(address);
            }
            catch (Exception ex)
            {
                //TODO
            }

            return null;
        }
    }
}